<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="UTF-8">
        <title>登录日志</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="shortcut icon" type="image/x-icon" th:href="@{/favicon.ico}"/>
        <link rel="stylesheet" th:href="@{/css/font.css}">
        <link rel="stylesheet" th:href="@{/css/xadmin.css}">
        <script type="text/javascript" th:src="@{/lib/jquery/jquery.min.js}"></script>
        <script charset="utf-8" th:src="@{/lib/layui/layui.js}"></script>
        <script type="text/javascript"  th:src="@{/js/xadmin.js}"></script>
        <link rel="stylesheet" th:href="@{/css/animate.min.css}">
    </head>

    <body class="animated fadeIn">
        <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="#">首页</a>
                <a href="#">系统管理</a>
                <a>
                  <cite>登录日志</cite>
                </a>
            </span>
            <a class="layui-icon layui-icon-refresh"
               style="float:right"
               href="javascript:location.replace(location.href);" title="刷新"></a>
        </div>

        <div class="x-body">
            <table class="layui-hide" id="login-log-table"></table>
        </div>

        <script>
            layui.use(['table', 'element', 'laydate'], function () {
                var table = layui.table;
                var $ = layui.$;

                table.render({
                    elem: '#login-log-table'
                    , url: '/log/login/list'
                    , page: true
                    , cols: [
                        [
                            {field: 'username', title: '用户名'}
                            , {field: 'loginTime', title: '登陆时间'}
                            , {field: 'loginStatus', title: '状态', templet: function (d) {
                                return d.loginStatus === '1' ? "成功" : "失败";
                            }, width: "15%"}
                            , {field: 'ip', title: 'IP'}
                        ]
                    ]
                });
            });
        </script>
    </body>

</html>